

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:study_flutter/thridLibary/widgets/painter/cricel/bezither_painter.dart';
import 'package:study_flutter/thridLibary/widgets/painter/cricel/cricle_painter.dart';

class ChartPage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() => _ChartState();

}

/*
* 具体详情见文章 https://juejin.cn/post/7023570967767023653
*
*  */

class _ChartState extends State<ChartPage>{
  @override
  Widget build(BuildContext context) {
    print("object");
    return Scaffold(
      appBar: AppBar(
        title: Text("绘图")
      ),
      body: Container(
        width: 1.sw,//MediaQuery.of(context).size.width,
        height: 1.sh,//MediaQuery.of(context).size.height,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              height: 100,
              child: CustomPaint(
                painter: CriclePainterWidget(),
              ),
            ),
            Container(
              height: 200,
              width: 200,
              // color: Colors.red,
              child: GestureDetector(
                child: CustomPaint(
                  painter: BezitherPainter(),
                ),
                onTap: (){
                  print("++++++++++");
                },
                onPanDown: (DragDownDetails detail){
                  print("++++++++++");
                  print(detail);
                },
                onPanUpdate:  (DragUpdateDetails detail){
                  print("++++++++++");
                },
              ),
            ),
            Container(
              height: 50,
              color: Colors.red,
            )
          ],
        ),
      ),
    );
  }

}